@include('new.newheader')
<link rel="stylesheet" href="{{URL::asset('/ucenter/css/base.css')}}">
{{--<link rel="stylesheet" href="{{URL::asset('/ucenter/css/bootstrap.min.css')}}">--}}
<!--[if lt IE 9]>
<script src="js/bootstrap/html5shiv.min.js"></script>
<script src="js/bootstrap/respond.min.js"></script>
<![endif]-->
<script>
    function perfectInfo() {
        $('#mask').hide();
        $('.tanCeng').hide();
    }
</script>

<link rel="stylesheet" href="{{URL::asset('/user/css/analystCenter.css')}}">
<link rel="stylesheet" href="{{ URL::asset('recommend/css/centerdata.css') }}">
<script>
    $('.sub-personCenter li').attr('class','');
    $('.sub-personCenter li:eq(1)').attr('class','active');
</script>
<br style="clear: both;">
<!-- 我的资料 -->
<div role="tabpanel" class="tab-pane" id="myData">
    <div class="box clearfix">
        <div class="renZheng">
            <!-- 左侧 -->
            <ul class="r_left">
                <li class="a_color active">
                    <span class="pic pic1">
                        <span><img src="{{URL::asset('/images/touxiangSelected.png')}}" alt=""></span>
                        <span class="r_left_color">基本信息</span>
                    </span>
                </li>
                <li>
                    <span class="pic pic2"><span><img src="{{URL::asset('/images/zhanghuSave.png')}}" alt=""></span><span class="r_left_color">账户安全</span></span>
                </li>
                <li>
                    <span class="pic pic3"><span><img src="{{URL::asset('/images/chongzhi.png')}}" alt=""></span><span class="r_left_color">VIP充值</span></span>
                </li>
                <li>
                    <span class="pic pic4"><span><img src="{{URL::asset('/images/renzheng.png')}}" alt=""></span><span class="r_left_color">分析师认证</span></span>
                </li>
                <li>
                    <span class="pic pic5"><span><img src="{{URL::asset('/recommend/images/huise.png')}}" alt=""></span><span class="r_left_color">推荐发布</span></span>
                </li>
                @if(count($tuijianStatus) == 1)
                <a href='/hrecommand?id={{Session::get('eai')['id']}}' target="_blank">
                    <li>
                        <span class="pic pic6"><span><img src="{{URL::asset('/recommend/images/recommendhistory/history.png')}}" alt=""></span><span class="r_left_color">历史发布</span>
                        </span>
                    </li>
                </a>
                @endif
               <!--  <li>
                    <span class="pic pic5"><span style="margin-left: 30px;">申请体验账户</span><span class="sanjiao"></span></span>
                </li> -->
            </ul>
            <!-- 右侧 -->
            <div class="r_right">
                <ul>
                    <!-- 基本信息 -->
                    <li style="display: block;">
					@include('userhandle.baseinfo')
                    </li>
                    <!-- 账户安全 -->
                    <li  style="display: none;">
                        @include('userhandle.security')
                    </li>
                    <!-- VIP充值 -->
                    <li style="display: none;"></li>
                    <!-- 分析师认证 -->
                    <li style="display: none;">
                        <!-- 用户填写信息 -->
                        <div class="r_tianxie" style="margin-top: 30px;">
                            <div class="r_top">
                                <div class="r_title">
                                    <span class="fl">身份认证</span>
                                    {{--<span class="fr" style="cursor: pointer;" onclick="shouBtn1()" id="sanjiao1">收起<img src="{{URL::asset('/images/shou.png')}}" alt=""></span>--}}
                                </div>
                                <div class="r_info" style="display: block;">
                                    <div class="r_info_top" style=" display: @if($authstatus == '0') block @else none @endif">
                                        <div class="r_nameInfo">
                                            <form action="" method="post">
                                                <div class="r_name">
                                                    姓名 <input type="text" id="r_name" name="username" value="" maxlength="6" placeholder="请输入真实姓名"><span id="l_tishi" style="color: rgb(0, 168, 238);margin-left: 10px;"></span>
                                                </div>
                                                <div class="r_num">
                                                    身份证号 <input type="text" id="r_num" name="idcard" value="" placeholder="请输入有效身份证件">
                                                </div>
                                            </form>
                                        </div>
                                        <div class="r_idCard">
                                            <div><span class="shenfen">身份认证</span><span class="tip">(请您上传字迹清晰的照片)</span></div>
                                            <div class="r_upLoad clearfix">
                                                <span style="line-height: 110px;margin-right: 18px;">上传身份证</span>
                                                <!-- 正面 -->
                                                <div class="front file_upload" id="frontBox">
                                                    <input style="display: none;" name="idcardimg" id="idcardimg" type="text"/>
                                                    <img src="{{URL::asset('/images/rect1.png')}}" alt="" id='img1'>
                                                    <form id="uploadzhengForm" name="uploadzhengForm" action="{{url('uploadimg')}}" method="post">
                                                        <input style="display: none;" name="image" id="front_icon" type="file" class="inputFile"/>
                                                        <input style="display: none;" name="type" type="text" value="2"/>
                                                    </form>
                                                </div>
                                                <!-- 反面 -->
                                                <div class="back file_upload" id="backBox">
                                                    <input style="display: none;" name="idcardimgf" id="idcardimgf" type="text"/>
                                                    <img src="{{URL::asset('/images/rect2.png')}}" alt="" id='img2'>
                                                    <form id="uploadfanForm" name="uploadfanForm" action="{{url('uploadimg')}}" method="post">
                                                        <input style="display: none;" name="image" id="back_icon" type="file" class="inputFile"/>
                                                        <input style="display: none;" name="type" type="text" value="2"/>
                                                    </form>
                                                </div>
                                            </div>
                                            <div class="r_exp clearfix">
                                                <span style="margin-right: 20px;padding-left:38px;line-height: 34px;">示例</span>
                                                <img src="{{URL::asset('/images/cover.png')}}" alt="">
                                            </div>
                                            <button class="touxiang_btn" onclick="doauth();">提交</button>
                                        </div>
                                    </div>
                                    <!-- 用户填写完信息后提示 -->
                                    <div class="r_success" style=" display: @if($authstatus == '1') block @else none @endif">
                                        <div class="success_pic"><img src="{{URL::asset('/images/success.png')}}" alt=""></div>
                                        <div class="succes_info">
                                            <div style="margin-bottom: 16px;">您已成功提交信息</div>
                                            <div>正在等待审核</div>
                                        </div>
                                        <button id="r_write" onclick="updateauth();">重新填写</button>
                                    </div>
                                   @if($authstatus == '2')
                                    <!-- 审核成功展示信息 -->
                                    <div class="r_info_top" style="display: @if($authstatus == '2') block @else none @endif">
                                            <div class="r_nameInfo" style="border-bottom: 0 none;">
                                                <form action="" method="post">
                                                    <div class="r_name">
                                                        姓名 : <span style="margin-left: 20px;">{{$authinfo->username}}</span>
                                                    </div>
                                                    <div class="r_num" style="margin-top: 40px;">
                                                        身份证号 : <span style="margin-left: 20px;">{{substr_replace($authinfo->idcard,'********','6','-4')}}</span>
                                                    </div>
                                                </form>
                                            </div>
                                    </div>
                                    @endif

                                    <!-- 审核后信息未通过的提示信息 -->
                                    <div class="r_error" style=" display: @if($authstatus == '3') block @else none @endif">
                                        <div class="error_pic"></div>
                                        <div class="error_info">
                                            <div>您提交的身份照片太模糊，请重新提交</div>
                                        </div>
                                        <button id="r_write" onclick="updateauth();">重新填写</button>
                                    </div>
                                </div>
                            </div>
                            <div class="r_bottom">
                                <div class="r_title">
                                    <span class="fl">学历认证</span>
                                    {{--<span class="fr" style="cursor: pointer;" onclick="shouBtn2()" id="sanjiao2">收起<a href="javascript:;"><img src="{{URL::asset('/images/shou.png')}}" alt=""></a></span>--}}
                                </div>
                                <div class="r_xueli">

                                    <div class="r_stuInfo" style="display: @if(!$authinfo) block @elseif($authinfo  && !$authinfo->diplomas) block @else none @endif">
                                        <div style="margin-top: 30px;">
                                            <span class="shenfen">学历认证</span>
                                            <span class="tip">(请务必保证信息的真实有效)</span>
                                        </div>
                                        <div class="r_name">
                                            学历 <input type="text" name="diplomas" id="diplomas" value="">
                                        </div>
                                        <div class="r_num">
                                            毕业院校 <input type="text" name="school" id="school" value="">
                                        </div>
                                        <button style="margin-left: 100px;" onclick="doschoole()">提交</button>
                                    </div>

                                    <!-- 学历提交成功后的展示信息 -->
                                    <div class="r_stuinfo_success" style="@if($authinfo && $authinfo ->diplomas) display:block @else display:none @endif">
                                        <div style="margin-top: 30px;">
                                            <span class="shenfen">学历认证</span>
                                            <span class="tip">(请务必保证信息的真实有效)</span>
                                        </div>
                                        <div class="r_name">
                                            学历 : <span id="diplomasshow">@if($authinfo){{$authinfo ->diplomas}}@endif</span>
                                        </div>
                                        <div class="r_num">
                                            毕业院校 : <span id='schoolshow'>@if($authinfo){{$authinfo ->school}}@endif</span>
                                        </div>
                                        <button id="r_write" onclick="updatestu();">重新填写</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </li>
                    <!-- 推荐发布 -->
                    <li style="display: none;">
                        @include('recommend.centerdata')
                    </li>
                    <!-- 历史发布 -->
                    <li style="display: none;">
                      
                    </li>
                    <!-- 申请体验账户 -->
                    <!-- <li style="display: none;">
                        <div class="r_tong_top">
                            <div class="r_tong_title">
                                开通体验账户
                            </div>
                        </div>
                        <div class="r_tong_bottom">
                            <div class="r_touxiang"></div>
                            <div class="info">开通体验账户</div>
                            <button id="r_tong_btn" onclick="r_tong()">立即开通</button>
                        </div>
                    </li> -->
                </ul>
            </div>
        </div>
    </div>
</div>
<div id="mask"></div>

<div class="kaitong_tip">您还未完善您的基本资料</div>

<div style="clear: both;"></div>

<body>

<!-- <script src="{{ URL::asset('public_js/jquery-1.8.3.min.js') }}"></script> -->
<script src="{{ URL::asset('public_js/jquery-3.2.1.min.js') }}"></script>
<!--<script src="{{URL::asset('/ucenter/js/bootstrap.min.js')}}"></script>-->
<script src="{{URL::asset('public_js/distpicker.data.js')}}"></script>
<script src="{{URL::asset('public_js/distpicker.js')}}"></script>
<script src="{{URL::asset('public_js/layDate.js')}}"></script>
<script src="{{URL::asset('/user/js/baseinfo.js')}}"></script>
<script>
//  $('.dropdown-toggle').dropdown()
</script>


<script>
    var zhengimg   = '{{url("images/rect1.png")}}';
    var fanimg     = '{{url("images/rect2.png")}}';
    var schoolurl  = '{{url("schoolauth")}}';
    var dobaseinfo = '{{url("dobaseinfo")}}';
    var type = '{{ $type }}';
    var renzheng = '{{url("/authenticate")}}';
    var imgurl     = "{{url('uploadimg')}}";//上传图片地址
    var cardauth   = "{{url('cardauth')}}"; //提交身份证地址
    var dophoto    = "{{url('dophoto')}}"; //头像上传
    var docashurl = '{{url('cash')}}';//去提现
    //申请体验账户
    // function r_tong(){
    //     var div_mask=$('#mask');
    //     var width=document.body.scrollWidth+'px';
    //     var height=document.body.scrollHeight+'px';
    //     div_mask.css({'width':width,'height':height,'display':'block'});
    //     $('.kaitong_tip').css('display','block');
    //     setInterval(function(){
    //         $('#mask').css('display','none');
    //         $('.kaitong_tip').css('display','none');
    //     },2000);
    //     // 若填写基本信息
    //     // if() {
    //     // 提示已开通
    //     // }else if
    // }
</script>
<script>
    var tiyan = '{{ $tiyan }}';
    var maxtime = tiyan*60*60*24; //15天的秒数
    var timer;

    function CountDown(){    //立即申请账户倒计时
        clearInterval(timer);
        if(maxtime>=0){
            console.log(maxtime);
            // 剩余天数
            var day = Math.floor(maxtime/ 60 / 60 / 24);
            //剩余小时
            var hours = Math.floor(maxtime/ 60 / 60 % 24);
            //剩余分钟数
            var minutes = Math.floor(maxtime % 3600 / 60); 
            var seconds = Math.floor(maxtime % 60); 
            var msg = "<span style='font-size:12px;'>体验账户倒计时： </span>"+"<span style='font-size:14px;'>"+day+"</span>"+"<span style='font-size:12px;'>天</span>"+"<span style='font-size:14px;'>" +hours+"</span>"+"<span style='font-size:12px;'>小时</span>" +"<span style='font-size:14px;'>"+minutes+"</span>"+"<span style='font-size:12px;'>分</span>"+"<span style='font-size:14px;'>"+seconds+"</span>"+"<span style='font-size:12px;'>秒</span>"; 
            $('#aBox').html(msg); 
            --maxtime; 
        }else{ 
            clearInterval(timer); 
            //一下两个方法是倒计时结束后调用的方法 
            $('#aBox').html('您的体验已结束,<a style="font-size:14px;color:#f6a405;">请充值！</a>');
            timer=setInterval("CountDown()",1000); 
        } 
    } 



    $(function(){  //申请体验账户
        var uid = '{{ $userinfo->id }}';
        var gotourl = "{{url('/applyAccount')}}";
        $('.reg_time').click(function(){
                $.ajax({
                url:gotourl,
                type: 'post',
                headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') },
                data: { 'uid':uid },
                async: false,
                dataType:'json',
                success: function(res){
                    var div_mask=$('#mask');
                    var width=document.body.scrollWidth+'px';
                    var height=document.body.scrollHeight+'px';
                    div_mask.css({'width':width,'height':height,'display':'block'});
                    // 返回json数据，判断状态
                    if(res.status == 0){
                        $('#mask').show();
                        $(".tanCeng").show();
                        $(".tanCeng > span").html("数据错误,请正确操作！");
                        $(".tanCeng > button").hide();
                        setInterval(function(){
                            $('#mask').hide();
                            $(".tanCeng").hide();
                        },3000);
                    }else if(res.status == 1){ //未完善资料,提示
                        $("#mask").show();
                        $(".tanCeng").show();
                        $(".tanCeng > span").html("您还未完善资料，请先去完善!");
                    }else if(res.status == 2) {  //完善资料,申请成功，倒计时开始
                        // 成功，倒计时开始
                        $("#mask").css('display','none');
                        $(".tanCeng").css('display','none');
                        $(".reg_time").hide();
                        endtime = Number(Date.parse(new Date())/1000 + Number('{{$tiyan*24*60*60}}'));
                        timer = setInterval("daojishi()",1000);
                    }
                }
            });

        });
    });
    
    
    var endtime = Number('{{$userinfo->applytime+$tiyan*24*60*60}}');
    function daojishi(){   //申请过体验账户，并且没有过期，页面刷新倒计时
        clearInterval(timer);
        var  nowtime = Date.parse(new Date());
        var leftTime = (endtime * 1000 - nowtime) / 1000;
        if(leftTime >= 0) {
            var day = Math.floor(leftTime / 60 / 60 / 24); //计算剩余的天数 
            var hours = Math.floor(leftTime / 60 / 60 % 24); //计算剩余的小时 
            var minutes = Math.floor(leftTime / 60 % 60);//计算剩余的分钟 
            var seconds = Math.floor(leftTime % 60);//计算剩余的秒数 
            msg = "<span style='font-size:12px;'>体验账户倒计时： </span>"+"<span style='font-size:14px;'>"+day+"</span>"+"<span style='font-size:12px;'>天</span>"+"<span style='font-size:14px;'>" +hours+"</span>"+"<span style='font-size:12px;'>小时</span>" +"<span style='font-size:14px;'>"+minutes+"</span>"+"<span style='font-size:12px;'>分</span>"+"<span style='font-size:14px;'>"+seconds+"</span>"+"<span style='font-size:12px;'>秒</span>"; 
            $('#aBox').html(msg);
            // --leftTime;
            timer=setInterval("daojishi()",1000);
        }else{
            clearInterval(timer);
            $('#aBox').html('您的体验已结束,<a style="font-size:14px;color:#f6a405;">请充值！</a>');
        }
    }
</script>
<script>
    (function($){
        $.fn.moreText = function(options){
            var defaults = {
                maxLength:50,
                mainCell:".desc",
                openBtn:'展开',
                closeBtn:'收起'
            }
            return this.each(function() {
                var _this = $(this);
                
                var opts = $.extend({},defaults,options);
                var maxLength = opts.maxLength;
                var TextBox = $(opts.mainCell,_this);
                var openBtn = opts.openBtn;
                var closeBtn = opts.closeBtn;
                
                var countText = TextBox.html();
                var newHtml = '';
                if(countText.length > maxLength){
                    newHtml = countText.substring(0,maxLength)+'...<span class="more">'+openBtn+'</span>';
                }else{
                    newHtml = countText;
                }
                TextBox.html(newHtml);
                TextBox.on("click",".more",function(){
                    if($(this).text()==openBtn){
                        TextBox.html(countText+' <span class="more">'+closeBtn+'</span>');
                    }else{
                        TextBox.html(newHtml);
                    }
                })
            })
        }
    })(jQuery);
    $(function(){
        $(".detail").moreText({
            maxLength: 100, //默认最大显示字数，超过...
            mainCell: '.desc' //文字容器
        });
    })
</script>
<style>
    body{
        background-color: #f4f4f4;
    }
    a:hover{
        text-decoration: none;
    }
    .r_xueli {
        height: 300px;
    }
    #header{
        top: 0;
    }
    .renZheng {
        margin-top: 44px;
        width: 100%;
    }
    .renZheng .r_left {
        width: 208px;
        height: 100%;
        background-color: #1e2535;
        margin-right: 24px;
        float: left;
        position: fixed;

    }
    .r_left_color{
        color: #fff;
        margin-left: 30px;
    }
    .renZheng .r_right{
        margin-left: 250px;
        width: 85%;
    }
    .renZheng .r_left li .pic > img{
        width: 100%;
        height: 100%;
    }
    .j_Essential{
        width: 98%;
        margin-top: 30px;
    }
    .j_Essential .j_Essential_content{
        height: 650px;
    }
    .j_Essential .j_Essential_content .j_content_right{
        width: 548px;
    }
    .j_Essential .j_Essential_content .j_content_right h3{
        margin-bottom: 20px;
    }
    .j_Essential .mysettings-packup .basic-wide{
        font-size: 14px;
        margin-right: 20px;
    }
    .j_Essential .userset-but-r{
        margin-left: 127px;
    }
    .renZheng .r_left li.active{
        background: #3b9ce0;
    }
    .renZheng .r_left li{
        padding-left: 54px;
    }
    .j_security{
        width: 98%;
        margin-top: 30px;
    }
    .j_security .j_security_title .mysettings-packup .fl{
        height: 20px;
    }
    .j_security .j_security_title .mysettings-packup .basic-wide{
        font-size: 14px;
    }
    .renZheng .r_right .r_bottom .r_stuinfo_success .r_name, .renZheng .r_right .r_bottom .r_stuinfo_success .r_num{
        font-size: 14px;
    }
</style>

